\(\int \frac {\cos ^2(e+f x)}{(a+a \sin (e+f x))^{3/2} (c-c \sin (e+f x))^{5/2}} \, dx\) [56]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [F]
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 38, antiderivative size = 104 \[ \int \frac {\cos ^2(e+f x)}{(a+a \sin (e+f x))^{3/2} (c-c \sin (e+f x))^{5/2}} \, dx=\frac {\cos (e+f x)}{2 a c f \sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}}+\frac {\text {arctanh}(\sin (e+f x)) \cos (e+f x)}{2 a c^2 f \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}} \]

[Out]

1/2*cos(f*x+e)/a/c/f/(c-c*sin(f*x+e))^(3/2)/(a+a*sin(f*x+e))^(1/2)+1/2*arctanh(sin(f*x+e))*cos(f*x+e)/a/c^2/f/
(a+a*sin(f*x+e))^(1/2)/(c-c*sin(f*x+e))^(1/2)

Rubi [A] (verified)

Time = 0.32 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {2920, 2822, 2820, 3855} \[ \int \frac {\cos ^2(e+f x)}{(a+a \sin (e+f x))^{3/2} (c-c \sin (e+f x))^{5/2}} \, dx=\frac {\cos (e+f x) \text {arctanh}(\sin (e+f x))}{2 a c^2 f \sqrt {a \sin (e+f x)+a} \sqrt {c-c \sin (e+f x)}}+\frac {\cos (e+f x)}{2 a c f \sqrt {a \sin (e+f x)+a} (c-c \sin (e+f x))^{3/2}} \]

[In]

Int[Cos[e + f*x]^2/((a + a*Sin[e + f*x])^(3/2)*(c - c*Sin[e + f*x])^(5/2)),x]

[Out]

Cos[e + f*x]/(2*a*c*f*Sqrt[a + a*Sin[e + f*x]]*(c - c*Sin[e + f*x])^(3/2)) + (ArcTanh[Sin[e + f*x]]*Cos[e + f*
x])/(2*a*c^2*f*Sqrt[a + a*Sin[e + f*x]]*Sqrt[c - c*Sin[e + f*x]])

Rule 2820

Int[1/(Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*Sqrt[(c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]]), x_Symbol] :> Di
st[Cos[e + f*x]/(Sqrt[a + b*Sin[e + f*x]]*Sqrt[c + d*Sin[e + f*x]]), Int[1/Cos[e + f*x], x], x] /; FreeQ[{a, b
, c, d, e, f}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0]

Rule 2822

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp
[b*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^n/(a*f*(2*m + 1))), x] + Dist[(m + n + 1)/(a*(2*m
 + 1)), Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x]
&& EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && ILtQ[Simplify[m + n + 1], 0] && NeQ[m, -2^(-1)] && (SumSimplerQ[m
, 1] ||  !SumSimplerQ[n, 1])

Rule 2920

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*sin[(e_.) + (f_.)*
(x_)])^(n_.), x_Symbol] :> Dist[1/(a^(p/2)*c^(p/2)), Int[(a + b*Sin[e + f*x])^(m + p/2)*(c + d*Sin[e + f*x])^(
n + p/2), x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[p
/2]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\int \frac {1}{\sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}} \, dx}{a c} \\ & = \frac {\cos (e+f x)}{2 a c f \sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}}+\frac {\int \frac {1}{\sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}} \, dx}{2 a c^2} \\ & = \frac {\cos (e+f x)}{2 a c f \sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}}+\frac {\cos (e+f x) \int \sec (e+f x) \, dx}{2 a c^2 \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}} \\ & = \frac {\cos (e+f x)}{2 a c f \sqrt {a+a \sin (e+f x)} (c-c \sin (e+f x))^{3/2}}+\frac {\text {arctanh}(\sin (e+f x)) \cos (e+f x)}{2 a c^2 f \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 7.50 (sec) , antiderivative size = 163, normalized size of antiderivative = 1.57 \[ \int \frac {\cos ^2(e+f x)}{(a+a \sin (e+f x))^{3/2} (c-c \sin (e+f x))^{5/2}} \, dx=\frac {\cos ^3(e+f x) \left (1-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )+\log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )+\left (\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right ) \sin (e+f x)\right )}{2 c^2 f (-1+\sin (e+f x))^2 (a (1+\sin (e+f x)))^{3/2} \sqrt {c-c \sin (e+f x)}} \]

[In]

Integrate[Cos[e + f*x]^2/((a + a*Sin[e + f*x])^(3/2)*(c - c*Sin[e + f*x])^(5/2)),x]

[Out]

(Cos[e + f*x]^3*(1 - Log[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] + Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/2]] + (Lo
g[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] - Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/2]])*Sin[e + f*x]))/(2*c^2*f*(-1
 + Sin[e + f*x])^2*(a*(1 + Sin[e + f*x]))^(3/2)*Sqrt[c - c*Sin[e + f*x]])

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(249\) vs. \(2(92)=184\).

Time = 0.22 (sec) , antiderivative size = 250, normalized size of antiderivative = 2.40

method result size
default \(-\frac {\left (\cos ^{2}\left (f x +e \right )\right ) \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right )-\cos \left (f x +e \right ) \sin \left (f x +e \right ) \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right )-\left (\cos ^{2}\left (f x +e \right )\right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )+\cos \left (f x +e \right ) \sin \left (f x +e \right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )+\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )-1\right ) \cos \left (f x +e \right )-\cos \left (f x +e \right ) \ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )+\cos ^{2}\left (f x +e \right )-\cos \left (f x +e \right ) \sin \left (f x +e \right )-\sin \left (f x +e \right )-1}{2 a \,c^{2} f \left (\cos \left (f x +e \right )-\sin \left (f x +e \right )+1\right ) \sqrt {a \left (1+\sin \left (f x +e \right )\right )}\, \sqrt {-c \left (\sin \left (f x +e \right )-1\right )}}\) \(250\)

[In]

int(cos(f*x+e)^2/(a+a*sin(f*x+e))^(3/2)/(c-c*sin(f*x+e))^(5/2),x,method=_RETURNVERBOSE)

[Out]

-1/2/a/c^2/f*(cos(f*x+e)^2*ln(csc(f*x+e)-cot(f*x+e)-1)-cos(f*x+e)*sin(f*x+e)*ln(csc(f*x+e)-cot(f*x+e)-1)-cos(f
*x+e)^2*ln(-cot(f*x+e)+csc(f*x+e)+1)+cos(f*x+e)*sin(f*x+e)*ln(-cot(f*x+e)+csc(f*x+e)+1)+ln(csc(f*x+e)-cot(f*x+
e)-1)*cos(f*x+e)-cos(f*x+e)*ln(-cot(f*x+e)+csc(f*x+e)+1)+cos(f*x+e)^2-cos(f*x+e)*sin(f*x+e)-sin(f*x+e)-1)/(cos
(f*x+e)-sin(f*x+e)+1)/(a*(1+sin(f*x+e)))^(1/2)/(-c*(sin(f*x+e)-1))^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 319, normalized size of antiderivative = 3.07 \[ \int \frac {\cos ^2(e+f x)}{(a+a \sin (e+f x))^{3/2} (c-c \sin (e+f x))^{5/2}} \, dx=\left [\frac {\sqrt {a c} {\left (\cos \left (f x + e\right ) \sin \left (f x + e\right ) - \cos \left (f x + e\right )\right )} \log \left (-\frac {a c \cos \left (f x + e\right )^{3} - 2 \, a c \cos \left (f x + e\right ) - 2 \, \sqrt {a c} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {-c \sin \left (f x + e\right ) + c} \sin \left (f x + e\right )}{\cos \left (f x + e\right )^{3}}\right ) - 2 \, \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {-c \sin \left (f x + e\right ) + c}}{4 \, {\left (a^{2} c^{3} f \cos \left (f x + e\right ) \sin \left (f x + e\right ) - a^{2} c^{3} f \cos \left (f x + e\right )\right )}}, -\frac {\sqrt {-a c} {\left (\cos \left (f x + e\right ) \sin \left (f x + e\right ) - \cos \left (f x + e\right )\right )} \arctan \left (\frac {\sqrt {-a c} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {-c \sin \left (f x + e\right ) + c}}{a c \cos \left (f x + e\right ) \sin \left (f x + e\right )}\right ) + \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {-c \sin \left (f x + e\right ) + c}}{2 \, {\left (a^{2} c^{3} f \cos \left (f x + e\right ) \sin \left (f x + e\right ) - a^{2} c^{3} f \cos \left (f x + e\right )\right )}}\right ] \]

[In]

integrate(cos(f*x+e)^2/(a+a*sin(f*x+e))^(3/2)/(c-c*sin(f*x+e))^(5/2),x, algorithm="fricas")

[Out]

[1/4*(sqrt(a*c)*(cos(f*x + e)*sin(f*x + e) - cos(f*x + e))*log(-(a*c*cos(f*x + e)^3 - 2*a*c*cos(f*x + e) - 2*s
qrt(a*c)*sqrt(a*sin(f*x + e) + a)*sqrt(-c*sin(f*x + e) + c)*sin(f*x + e))/cos(f*x + e)^3) - 2*sqrt(a*sin(f*x +
 e) + a)*sqrt(-c*sin(f*x + e) + c))/(a^2*c^3*f*cos(f*x + e)*sin(f*x + e) - a^2*c^3*f*cos(f*x + e)), -1/2*(sqrt
(-a*c)*(cos(f*x + e)*sin(f*x + e) - cos(f*x + e))*arctan(sqrt(-a*c)*sqrt(a*sin(f*x + e) + a)*sqrt(-c*sin(f*x +
 e) + c)/(a*c*cos(f*x + e)*sin(f*x + e))) + sqrt(a*sin(f*x + e) + a)*sqrt(-c*sin(f*x + e) + c))/(a^2*c^3*f*cos
(f*x + e)*sin(f*x + e) - a^2*c^3*f*cos(f*x + e))]

Sympy [F(-1)]

Timed out. \[ \int \frac {\cos ^2(e+f x)}{(a+a \sin (e+f x))^{3/2} (c-c \sin (e+f x))^{5/2}} \, dx=\text {Timed out} \]

[In]

integrate(cos(f*x+e)**2/(a+a*sin(f*x+e))**(3/2)/(c-c*sin(f*x+e))**(5/2),x)

[Out]

Timed out

Maxima [F]

\[ \int \frac {\cos ^2(e+f x)}{(a+a \sin (e+f x))^{3/2} (c-c \sin (e+f x))^{5/2}} \, dx=\int { \frac {\cos \left (f x + e\right )^{2}}{{\left (a \sin \left (f x + e\right ) + a\right )}^{\frac {3}{2}} {\left (-c \sin \left (f x + e\right ) + c\right )}^{\frac {5}{2}}} \,d x } \]

[In]

integrate(cos(f*x+e)^2/(a+a*sin(f*x+e))^(3/2)/(c-c*sin(f*x+e))^(5/2),x, algorithm="maxima")

[Out]

integrate(cos(f*x + e)^2/((a*sin(f*x + e) + a)^(3/2)*(-c*sin(f*x + e) + c)^(5/2)), x)

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.62 \[ \int \frac {\cos ^2(e+f x)}{(a+a \sin (e+f x))^{3/2} (c-c \sin (e+f x))^{5/2}} \, dx=\frac {\frac {\log \left (-\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 1\right )}{a^{\frac {3}{2}} c^{\frac {5}{2}} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} - \frac {2 \, \log \left ({\left | \cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}\right )}{a^{\frac {3}{2}} c^{\frac {5}{2}} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} + \frac {1}{{\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )} a^{\frac {3}{2}} c^{\frac {5}{2}} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{4 \, f} \]

[In]

integrate(cos(f*x+e)^2/(a+a*sin(f*x+e))^(3/2)/(c-c*sin(f*x+e))^(5/2),x, algorithm="giac")

[Out]

1/4*(log(-cos(-1/4*pi + 1/2*f*x + 1/2*e)^2 + 1)/(a^(3/2)*c^(5/2)*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e))*sgn(sin(-
1/4*pi + 1/2*f*x + 1/2*e))) - 2*log(abs(cos(-1/4*pi + 1/2*f*x + 1/2*e)))/(a^(3/2)*c^(5/2)*sgn(cos(-1/4*pi + 1/
2*f*x + 1/2*e))*sgn(sin(-1/4*pi + 1/2*f*x + 1/2*e))) + 1/((cos(-1/4*pi + 1/2*f*x + 1/2*e)^2 - 1)*a^(3/2)*c^(5/
2)*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e))*sgn(sin(-1/4*pi + 1/2*f*x + 1/2*e))))/f

Mupad [F(-1)]

Timed out. \[ \int \frac {\cos ^2(e+f x)}{(a+a \sin (e+f x))^{3/2} (c-c \sin (e+f x))^{5/2}} \, dx=\int \frac {{\cos \left (e+f\,x\right )}^2}{{\left (a+a\,\sin \left (e+f\,x\right )\right )}^{3/2}\,{\left (c-c\,\sin \left (e+f\,x\right )\right )}^{5/2}} \,d x \]

[In]

int(cos(e + f*x)^2/((a + a*sin(e + f*x))^(3/2)*(c - c*sin(e + f*x))^(5/2)),x)

[Out]

int(cos(e + f*x)^2/((a + a*sin(e + f*x))^(3/2)*(c - c*sin(e + f*x))^(5/2)), x)